<?php

/**
 * pais actions.
 *
 * @package    kernel
 * @subpackage pais
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
 */
class paisActions extends autopaisActions
{
  
  public function executeGetDepartamentos()
  {
    
    $pais_id = $this->getRequestParameter('id');
    $c = new Criteria();
    $c->add(KernelDepartamentoPeer::PAIS_ID,   $pais_id);
    
    $deptos = KernelDepartamentoPeer::doSelect($c);
    
    $cad = "";
    $depto_default = null;
    foreach($deptos as $dep)
    {
      if($depto_default == null)$depto_default = $dep->getId();
      $cad .= $dep->getId()."###".$dep->getNombre()."---";
    }

    $cad .= "--*--";
    $c = null;
    $c = new Criteria();
    $c->add(KernelCiudadPeer::DEPARTAMENTO_ID,   $depto_default);
    $ciudades = KernelCiudadPeer::doSelect($c);
    foreach($ciudades as $ciu)
    {
      
      $cad .= $ciu->getId()."###".$ciu->getNombre()."---";
    }

    $this->response->setContent($cad);
    return sfView::NONE; 
  }
}
